﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace YasharEl.Infrastructure.ProcessEngine.DomainModel
{
    [ContractClass(typeof(ProcessManagerContract))]
    public interface IProcessManager
    {
        IProcess UpdateProcessProperties(long userId, Guid workflowInstanceId, Dictionary<string, object> inputs);

        IProcess UpdateMainApplicationEntity(long userId, Guid workflowInstanceId);
    }

    [ContractClassFor(typeof(IProcessManager))]
    internal abstract class ProcessManagerContract : IProcessManager
    {
        #region IProcessManager Members

        public IProcess UpdateProcessProperties(long userId, Guid workflowInstanceId, Dictionary<string, object> inputs)
        {
            Contract.Requires<ArgumentNullException>(userId > 0, "userId should be valid positive number.");
            Contract.Requires<ArgumentNullException>(workflowInstanceId != Guid.Empty, "workflowIntanceId must be valid Guid.");

            return default(IProcess);
        }

        public IProcess UpdateMainApplicationEntity(long userId, Guid workflowInstanceId)
        {
            Contract.Requires<ArgumentNullException>(userId > 0, "userId should be valid positive number.");
            Contract.Requires<ArgumentNullException>(workflowInstanceId != Guid.Empty, "workflowIntanceId must be valid Guid.");

            return default(IProcess);
        }

        #endregion
    }
}
